#include <iostream>
#include <vector>
#include <cstring>
using namespace std;

int get(int s, int j)
{
	return (s >> j) & 1;
}

int set(int s, int j, int v)
{
	return v == 0 ? (s & (~(1 << j))) : (s | (1 << j));
}

long cal(int n, int i, int j, int s, int lu, int k)
{
	if (i == n) {
		return k == 0 ? 1 : 0;
	}

	if (j == n) {
		return cal(n, i + 1, 0, s, 0, k);
	}

	int left = j == 0 ? 0 : get(s, j - 1);
	int up = get(s, j);
	int rightup = get(s, j + 1);
	long ans = cal(n, i, j + 1, set(s, j, 0), up, k);
	if (k > 0 && left == 0 && lu == 0 && up == 0 && rightup == 0) {
		ans += cal(n, i, j + 1, set(s, j, 1), up, k - 1);
	}

	return ans;
}

long cal_dp(int n, int kings)
{
	long dp[n + 1][1 << n][2][kings + 1];
	for (int s = 0; s < (1 << n); s++) {
		for (int k = 0; k <= kings; k++) {
			dp[n][s][0][k] = k == 0 ? 1 : 0;
			dp[n][s][1][k] = k == 0 ? 1 : 0;
		}
	}

        long ans = 0;
	for (int i = n - 1; i >= 0; i--) {
		for (int j = n - 1; j >= 0; j--) {
			for (int s = 0; s < (1 << n); s++) {
				for (int leftup = 0; leftup <= 1; leftup++) {
					for (int k = 0; k <= kings; k++) {
						int left = j == 0 ? 0 : get(s, j - 1);
						int up = get(s, j);
						int rightup = get(s, j + 1);
						ans = dp[j + 1][set(s, j, 0)][up][k];
						if (k > 0 && left == 0 && leftup == 0 && up == 0 && rightup == 0) {
							ans += dp[j + 1][set(s, j, 1)][up][k - 1];
						}
						dp[j][s][leftup][k] = ans;
					}
				}
			}
		}
                ans = dp[0][0][0][kings];
                for (int s = 0; s < (1 << n); s++) {
			for (int k = 0; k <= kings; k++) {
				dp[n][s][0][k] = dp[0][s][0][k];
				dp[n][s][1][k] = dp[0][s][0][k];
			}
		}
	}
        return ans;
}

int main()
{
	int n, k;
	cin >> n >> k;
	//cout << cal(n, 0, 0, 0, 0, k) << endl;
        cout << cal_dp(n, k) << endl;
	return 0;
}